package com.qcby.llmtchstd.service.Impl;

import com.qcby.llmtchstd.dao.TeachingPlanDao;
import com.qcby.llmtchstd.entity.TeachingPlan;
import com.qcby.llmtchstd.service.TeachingPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class TeachingPlanServiceImpl implements TeachingPlanService {
    @Autowired
    private TeachingPlanDao teachingPlanDao;

    @Override
    public TeachingPlan selectThis(String name) {
        return teachingPlanDao.selectThis(name);
    }

    @Override
    public int deleteThis(int id) {
        return teachingPlanDao.deleteThis(id);
    }


    @Override
    public TeachingPlan createPlan(TeachingPlan plan) {
        teachingPlanDao.insertPlan(plan);
        return plan;
    }

    @Override
    public TeachingPlan selectById(int id) {
        return teachingPlanDao.selectById(id);
    }

    @Override
    public List<TeachingPlan> listAll() {
        return teachingPlanDao.listAll();
    }

    @Override
    public TeachingPlan generateWithAI(String prompt) {
        // 这里可以添加一些业务逻辑，如验证、日志记录等
        // 实际的AI生成在Controller中完成
        return null; // 这个实现不会被直接调用
    }

    @Override
    public List<TeachingPlan> searchByName(String name,int id) {
        return teachingPlanDao.searchByName(name,id);
    }

    @Override
    public List<TeachingPlan> selectPage(int offset, int pageSize,int id) {
        return teachingPlanDao.selectPage(offset, pageSize,id);
    }

    @Override
    public Integer countSer(String name, int id) {
        return teachingPlanDao.countSer(name,id);
    }

    @Override
    public int selectCount(Integer id) {
        return teachingPlanDao.selectCount(id);
    }

}